package com.sxf.rental.config;


import com.sxf.rental.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalException {

    @ExceptionHandler(Exception.class)
    public Result handleException(Exception e) {
        log.error("异常信息:{}",e.getMessage());
        e.printStackTrace();
        return Result.fail().setMessage(e.getMessage());
    }
}
